<!-- Web Upload Data Delete PHP File -->
<!-- Reveions History ...
	Rev 1.00 at 2015/06/08 by Max Yin:
		1. First time create
	Rev 1.01 at 2015/07/08 by Max Yin:
		1. 由標楷體, 改成新細明體
		2. 增加 FTP 上 Delete File 功能, 及是否要 delete 勾选
		3. 可删除 MySQL 上, 不同站别, 但相同版本及描述
	Reb 1.08 at 2015/12/08 by Max Yin,
		1. Web SMT upload 增加-回流焊的选项。(eric_liang)
		2. Web SMT upload/download, 由填入栏位改为下拉选单。(eric_liang)
		3. Web Upload/Downlaod 新增加 ESD 下拉选单。(jianwei_wang)
		4. 移除 ftp IP 的栏位输入, 由 Web 程式内定 FTP 路径。(Lucas)
		5. 修正重复上传, 却只有版本不对, 导致无法上传问题。(mingshen_feng)
		6. 修正若上传者, 若没有上传者名称, 会要求重新登入讯息。
-->
<html>
	<body background="pic/background_06.gif">
	<head>
		<font face="新細明體,time new roman,Arial">
		<meta charset="UTF-8">
	</head>
	<body>
		<center>
			<font size="5" color="#0000FF"><b>--- 程式,查询结果 ---</b></font><br>
			<hr>
			<?php
				require_once('class_package/common.php');
				$admin_member = new member();
				$tmp_by				= $_COOKIE['login_user'];		
				$creator			= '';
				$url  				= 'webul_download_delete_html.php' ; 
					
				if ( ! @isset($_GET[creator]) ) {
					echo "<script language=javascript>alert('无此信息!');history.go(-1);</script>";
					exit();
				}	
				@$creator = $_GET[creator];
				
				// 由 user name 去判断, 是否为 admin 成员 ...
				$is_admin_member = 0;
				foreach ( $admin_member->getMembers() as $value ) {
					if ( $tmp_by == $value ) {
						$is_admin_member = 1;
						break;
					}
				}
				
				// 非Admin成员, 不允許刪除他人建立資料的動作...
				if ( $is_admin_member == 0 ) {
					if ($tmp_by != $creator){
						echo "<script>alert('該筆資料只能由上傳者 $creator 進行刪除!');history.go(-1);</script>";
						exit();
					} 
				}
				echo "<script  type='text/javascript'>";
				echo "location.href='$url'"; 
				echo "</script>";
				echo '<script language="javascript">history.go(-1);</script>';	
			?>
		</center>
	</body>
</html>

